<html>
<head>
<title>JavaScript Experiments: Divo Vortex Animation in 256 Bytes</title>
<style type="text/css">
body{background:#FFF;color:#000;}
a{color:#000;}
a:hover{color:#666;}
address{bottom:10px;font-family:Georgia;font-style:normal;position:absolute;right:10px;text-align:right;}
</style>
</head>
<body>

<!--

This script was made for my (D)HTML competition "256b.htm" (see
http://wildmag.de/compo/). The original script is 256 bytes small. It
uses the "all" object collection, which is a bad "Internet Explorer only" but
makes the code smaller. Here it is:

<script>s=Math.sin;z=0;function a(){for(i=0;i<50;){z?0:document.write('<b id=x'+i+' style=position:absolute><big>O</big><sub>'+i+'</sub></b>');w=i*s(z);o=eval('x'+i).style;o.top=s(w)*i*4+230;o.left=s(w+2)*i++*4+230}z+=.015;setTimeout('a()',50)}a()</script>

The following version of the script is a lot larger, contains comments and runs
in every browser.

-->

<script type="text/javascript">

/* Create a shortcut so we can call s() instead of Math.sin(). */
var s = Math.sin;
var z = 0;

for (i = 0; i < 50; i++)
{
	document.write('<b id="x' + i + '" style="position:absolute;"><big>O</big><sub>' + i + '</sub></b>');
}

function a()
{
	for (i = 0; i < 50; i++)
	{
		w = i * s(z);
		o = document.getElementById('x' + i).style;
		o.top  = s(w)     * i * 4 + 230;
		o.left = s(w + 2) * i * 4 + 230;
	}
	z += 0.015;
	setTimeout(a, 50);
}

a();

</script>

<address>&copy; <a href="http://maettig.com/">Thiemo M&auml;ttig</a>,
created in <a href="http://wildmag.de/compo/">February 2002</a><br />
<a href="./">More JavaScript experiments &raquo;</a></address>

</body>
</html>